package db

import (
	"fmt"
)

func PushCode(accountName string, ptitle string, code string, codetype string, rate float32) {
	// println("INSERT INTO codepush(accountName,code,codetype,rate) VALUES(," + accountName + "," + code + "," + codetype + ")")
	_, err := Dd.Exec("INSERT INTO codepush(accountName,ptitle,code,codetype,rate) VALUES(?,?,?,?,?)", accountName, ptitle, code, codetype, rate)
	if err != nil {
		fmt.Println("PushCode", err)
	}
}

var inputID int = 0

func PushCodeTestcase(ptitle string, inputTest string, outputTest string) {
	_, err := Dd.Exec("INSERT INTO tests(Id,title,input,output) VALUES(?,?,?,?)", inputID, ptitle, inputTest, outputTest)
	if err != nil {
		fmt.Println("PushCodeTestcase", err)
	}
	inputID++
}
